<?php


namespace app\index\model;


use think\Model;

class StockWarehouse extends Model
{
    public static function getStockWarehouseList($group=0): array
    {
        $StockWarehouseClass = new self();
        if($group) {
            $warehouse_id = GroupWarehouse::getWareHouseByGroup($group);
            $where['id']=['in',$warehouse_id];
        }

        $where['del_flag']=['=',0];
        $stock_warehouse_obj=$StockWarehouseClass->where($where)
            ->field('id,name')
            ->select();
        $stock_warehouse_data=$stock_warehouse_obj->toArray();
        return ['status'=>true,'result'=>['stock_warehouse'=>$stock_warehouse_data]];
    }
}